find the second smallest element in an array